<template>
  <div>
    <h1>Utils Code Example</h1>
    <HighlightCode :code="formattedCode" />
  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue';
import { exampleFunction } from '@/utils/example'
import HighlightCode from '@/components/HighlightCode/index.vue';

export default defineComponent({
  components: {
    HighlightCode,
  },
  data() {
    return {
      // 获取 utils 函数的代码字符串
      formattedCode: this.getFunctionCode(),
    };
  },
  methods: {
    getFunctionCode(): string {
      return exampleFunction.toString();
    },
  },
});
</script>

<style scoped>
/* 你的样式 */
</style>
